#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
char s[100100];
char c[35];
int nt[35];
int len1;
int len2;
void getnt()
{
	int i = 0;
	int t = -1;
	nt[0]= -1;
	while(i<len2)
	{
		if(t==-1||c[i]==c[t])
		{
			i++;
			t++;
			nt[i]=t;
		}
		else t = nt[t];
	}
}
int kmp()
{
	int i = 0;
	int j = 0;
	int ans = 0;
	while(i<len1)
	{
		if(j==-1||s[i]==c[j])
		{
			i++;
			j++;
		}
		else j = nt[j];
		if(j==len2)
		{
			j=0;
			ans++;
		}
	}
	return ans;
}
int main()
{
	while(scanf("%s %s",s,c)!=EOF)
	{
		len1 = strlen(s);
		len2 = strlen(c);
		getnt();
		int ans = kmp();
		printf("%d\n",ans);
	}
}
